﻿<%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="List.aspx.cs" Inherits="sistemaAcademicoFinanceiroEscolas.matriculasList.List" %>

<%@ Register src="~/DynamicData/Content/GridViewPager.ascx" tagname="GridViewPager" tagprefix="asp" %>
<%@ Register src="~/DynamicData/Content/FilterUserControl.ascx" tagname="DynamicFilter" tagprefix="asp" %>

<%@ Register assembly="Catalyst.Web.DynamicData" namespace="Catalyst.Web.DynamicData" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true" />
    
    <div class="tamanho">

    <h2>Lista de Matrículas</h2>

    <asp:ScriptManagerProxy runat="server" ID="ScriptManagerProxy1" />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
                HeaderText="Lista de erros de validação" />
            <asp:DynamicValidator runat="server" ID="GridViewValidator" ControlToValidate="GridView1" Display="None" />
            
            <asp:DynamicFilterForm ID="DynamicFilterForm1" runat="server" DataSourceID="GridDataSource">
                    <FilterTemplate> 
                    
                    Nome do aluno
            <asp:DynamicFilterControl  runat="server" ID="DynamicFilterControl1" DataField="aluno"
                        OnSelectedIndexChanged="OnFilterSelectedIndexChanged" />
                
                        Ano Letivo
                        
                        <asp:DynamicFilterControl  runat="server" ID="DynamicFilter" DataField="anoLetivo"
                        OnSelectedIndexChanged="OnFilterSelectedIndexChanged" />
                        
                        <%--Série
                        
                        <asp:DynamicFilterControl  runat="server" ID="DynamicFilterControl1" DataField="serie"
                        OnSelectedIndexChanged="OnFilterSelectedIndexChanged" />--%>
                       
                        <asp:Button ID="LinkButton1" runat="server" CommandName="Search" Text="Procurar"></asp:Button><br />
                        
                    </FilterTemplate>
            </asp:DynamicFilterForm>
           <br />
            
            <asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource"
                AllowPaging="True" AllowSorting="True" CssClass="gridview" AutoGenerateColumns="False" OnRowDataBound="RowDataBound" Width="99%">
                <Columns>
                
                    <asp:DynamicField DataField="aluno" HeaderText="Aluno " />
                    <asp:DynamicField DataField="anoLetivo" HeaderText="Ano Letivo " />
                    <asp:DynamicField DataField="serie" HeaderText="Série " />
                    <asp:DynamicField DataField="modalidadeAula" HeaderText="Modalidade da aula " />
                    <asp:DynamicField DataField="diaPagamento" HeaderText="Dia do pagamento " />
                    <asp:DynamicField DataField="tipoPagamento" HeaderText="Tipo do pagamento " />
                    <asp:DynamicField DataField="formaPagamento" HeaderText="Forma de pagamento " />
                    <asp:DynamicField DataField="observacoesMatricula" HeaderText="Observações " />
                    <asp:TemplateField HeaderText="Disciplinas " />
                     <%--A coluna abaixo será alimentada em tempo de execução--%>
                     
                    
                    
                    <asp:TemplateField HeaderText="Ações">
                        
                        <ItemTemplate>

                            <asp:HyperLink ID="DetailsHyperLink" runat="server" title="Visualizar todas informações"
                                NavigateUrl='<%# table.GetActionPath(PageAction.Details, GetDataItem()) %>'
                                ImageUrl="~/images/btVer.gif" />
                                
                                
                            <a href="#" onclick="javascript:window.open('<%=ConfigurationManager.AppSettings["url"] %>/matriculas/modificarMatricula.aspx?codigoAluno=<%#Eval("codigoAluno") %>&codigoMatricula=<%#Eval("codigoMatricula") %>','Aluno','location=0,resizable=0,status=0,scrollbars=0,width=580,height=410');"> <img src="<%=ConfigurationManager.AppSettings["url"]%>/images/btRealizarMatricula.gif" title="Modificar a Matrícula do Aluno" border="0"></a>
                            
                            
                         
                            <a href="<%=ConfigurationManager.AppSettings["url"] %>/pagamentoAlunos/List.aspx?codigoMatricula=<%#Eval("codigoMatricula")%>"><img src="<%=ConfigurationManager.AppSettings["url"] %>/images/btnImposto.png" title="Definir pagamento" border="0"></a>
                             
                           
                            <a href="#" onclick="javascript:window.open('<%=ConfigurationManager.AppSettings["url"] %>/deletarMatriculaAluno.aspx?codigoAluno=<%#Eval("codigoAluno") %>&codigoMatricula=<%#Eval("codigoMatricula") %>','Aluno','location=0,resizable=0,status=0,scrollbars=0,width=580,height=410');">Excluir</a>
                                
                            <%--<asp:LinkButton ID="DeleteLinkButton" runat="server" CommandName="Delete"
                                CausesValidation="false" Text="Excluir" title="Excluir"
                                OnClientClick='return confirm("Tem certeza que deseja excluir a Matrícula?");'
                            />&nbsp;--%>      
                            
                        </ItemTemplate>
                        
                    </asp:TemplateField>

                </Columns>

                <PagerStyle CssClass="footer"/>        
                <PagerTemplate>
                    <asp:GridViewPager ID="GridViewPager1" runat="server" />
                </PagerTemplate>
                <EmptyDataTemplate>
                    Não existem matrículas cadastradas no sistema.
                </EmptyDataTemplate>
            </asp:GridView>
            
            <script language="JavaScript">

                function progRealizada() {
                    alert('Progressão Cadastrada.');
                    window.close();


                }
                  </script>

             <asp:DynamicLinqDataSource ID="GridDataSource" runat="server" ContextTypeName="sistemaAcademicoFinanceiroEscolas.modeloDataContext"
                TableName="matriculas" EnableDelete="True">
                
            
            </asp:DynamicLinqDataSource>

            <br />
            
             
          
      

     
            

            
            <br>
            
            <a href="<%=ConfigurationManager.AppSettings["url"]%>/DefaultMenu.aspx">Voltar</a>
            
        </ContentTemplate>
    </asp:UpdatePanel>
    
    </div>
    
</asp:Content>
